<!DOCTYPE html>
<%@page import="com.faeple.util.SessionManager"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ page language="java" contentType="text/html;  charset=utf-8" pageEncoding="utf-8"%>
<html lang="ko">
	<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	
	<title>Faeple</title>
	
	<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
	<!--[if lt IE 9]>
		<script src="/resources/js/html5shiv.js"></script>
		<script src="/resources/js/respond.min.js"></script>
	<![endif]-->
	<link href='http://fonts.googleapis.com/css?family=Alef' rel='stylesheet' type='text/css'>
	<link rel="stylesheet" href="/resources/css/font-awesome.css">
	<link rel="stylesheet" href="http://fonts.googleapis.com/earlyaccess/nanumgothic.css">
	<style type="text/css">
		body {
			color:#333;
		}
		.title-form { width:100%; padding: 6px 0; background-color: #f5f5f5; border:0; outline: none; }
	</style>
</head>
<body>
<%@ include file="menu.jsp" %>

<div class="container">
	<div class="page-header">
		<h2 id="tables">글수정</h2>
    </div>
	<div>
		<form action="/config/admin/noticeUpdate" id="update-form" method="post">
		<input type="hidden" id="idx" name="idx" value="${notice.idx}">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title"><input class="title-form" type="text" placeholder="제목" id="title" name="title" value="${notice.title}"></h3>
			</div>
			<div class="panel-body" style="padding:0;">
				<textarea name="content" id="content" rows="10" cols="100" style="width:100%; height:412px; display:none;">${notice.content}</textarea>
			</div>
		</div>
		</form>
	</div>
	<div>
		<div style="float:left;">
		</div>
		<div style="float:right;">
			<button type="button" class="btn btn-primary" onclick="updateForm()">수정</button>
			<a href="/config/admin/notice" class="btn btn-default">취소</a>
		</div>
		<div class="clearfix"></div>
	</div>
</div>
</body>
<script src="/resources/js/jquery-1.11.0.js"></script>
<script src="/resources/js/jquery-ui-1.10.4.custom.min.js"></script>
<script src="/resources/js/bootstrap.js"></script>
<script src="/resources/SmartEditor/js/HuskyEZCreator.js"></script>
<script type="text/javascript">
	var oEditors = [];
	
	//추가 글꼴 목록
	//var aAdditionalFontSet = [["MS UI Gothic", "MS UI Gothic"], ["Comic Sans MS", "Comic Sans MS"],["TEST","TEST"]];
	
	nhn.husky.EZCreator.createInIFrame({
		oAppRef: oEditors,
		elPlaceHolder: "content",
		sSkinURI: "/resources/SmartEditor/SmartEditor2Skin.html",	
		htParams : {
			bUseToolbar : true,				// 툴바 사용 여부 (true:사용/ false:사용하지 않음)
			bUseVerticalResizer : true,		// 입력창 크기 조절바 사용 여부 (true:사용/ false:사용하지 않음)
			bUseModeChanger : true,			// 모드 탭(Editor | HTML | TEXT) 사용 여부 (true:사용/ false:사용하지 않음)
			//aAdditionalFontList : aAdditionalFontSet,		// 추가 글꼴 목록
			fOnBeforeUnload : function(){
				//alert("완료!");
			}
		}, //boolean
		fOnAppLoad : function(){
			//var sHtml = $("#content").val();
			//alert(sHtml);
			//oEditors.getById["content"].exec("PASTE_HTML", [sHtml]);
		},
		fCreator: "createSEditor2"
	});
	
	function updateForm(){
		oEditors.getById["content"].exec("UPDATE_CONTENTS_FIELD", []);
		$("#update-form").submit();
	}
	
	$(function(){
		$(".navbar-nav").children("li").eq(4).addClass("active");
	});
</script>
</html>